package com.leetcode.alibaba;

import java.util.Arrays;

public class 数组中出现次数超过一半的数字 {
	public static int MoreThanHalfNum_Solution(int [] array) {
		int half = array.length / 2;
		Arrays.sort(array);
		return array[half];
	}

	public static void main(String[] args) {
		int[] array = {3, 3, 3, 3, 2, 2, 2};
		System.out.println(MoreThanHalfNum_Solution(array));
	}
}
